import time

# 同步任务
def sync_task(task_id):
    print(f"Sync task {task_id} started")
    time.sleep(2)  # 模拟耗时操作
    print(f"Sync task {task_id} completed")

# 同步执行
def run_sync():
    start_time = time.time()
    for i in range(3):
        sync_task(i)
    print(f"Sync tasks completed in {time.time() - start_time:.2f} seconds")

# 运行同步任务
run_sync()